<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>bcrypt.js test</title>
	<script type="text/javascript" src="./js/bcrypt.js"></script>
	<script type="text/javascript" src="./js/isaac.js"></script>
</head>
<body>

</body>
<script type="text/javascript">
	var bcrypt = dcodeIO.bcrypt;

	console.log(isaac)


	// bcrypt.setRandomFallback((num) => {
	//   const buf = new Uint8Array(num);
	//   return buf.map(() => Math.floor(isaac.random() * 256));
	// })


	const hashT = '$2a$10$ReRJ5lEkURFQKCLR.Fo.du6TNlo2IJ2KJDke6uXY7aGMdrtncbACm'

	const password = '123456'
	const salt = bcrypt.genSaltSync(10);
	const passwordHash = bcrypt.hashSync(password, salt);

	console.log(passwordHash, bcrypt.compareSync(password, passwordHash))
	console.log('hashT', bcrypt.compareSync(password, hashT))


	document.write(`${passwordHash} ===> ${bcrypt.compareSync(password, passwordHash)}<br/>`)

	document.write('旧的：<br/>')
	document.write(`${hashT} ===> ${bcrypt.compareSync(password, hashT)}<br/>`)

</script>
</html>